package com.otaku.controller.pool;

import edu.uci.ics.crawler4j.crawler.CrawlController;
import edu.uci.ics.crawler4j.crawler.WebCrawler;

public class MyCrawlerController {
	private CrawlController cc;
	private Class<WebCrawler> className;
	private int threadNum;
	
	public <T extends WebCrawler> MyCrawlerController(CrawlController cc, Class<T> className,
			int threadNum) {
		super();
		this.cc = cc;
		this.className = (Class<WebCrawler>) className;
		this.threadNum = threadNum;
	}
	
	public void run(){
		cc.startNonBlocking(className, threadNum);
	}

	public Class<WebCrawler> getClassName() {
		return className;
	}

	public void setClassName(Class<WebCrawler> className) {
		this.className = className;
	}

	public int getThreadNum() {
		return threadNum;
	}

	public void setThreadNum(int threadNum) {
		this.threadNum = threadNum;
	}

	public CrawlController getCc() {
		return cc;
	}

	public void setCc(CrawlController cc) {
		this.cc = cc;
	}
	
	
}
